#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

def printCoords(event):
    print 'event.char=', event.char
    print 'event.keycode=', event.keycode

bt1 = Button(root, text='Press any key')
bt1.bind('<Key>', printCoords)

bt1.focus_set()
bt1.grid()

root.mainloop()
